package com.codejam.hello.world.anno.check.odd;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class OddCheck implements ConstraintValidator<IsOdd,Integer> {

    /**
     * odd,奇数
     * @param constraintAnnotation
     */
    @Override
    public void initialize(IsOdd constraintAnnotation) {
        System.out.println("初始化...");

    }


    @Override
    public boolean isValid(Integer integer, ConstraintValidatorContext constraintValidatorContext) {
        System.out.println("进入验证了66666");
        return integer % 2 == 0;
    }
}
